package com.suyang.syt.model.dto;

import java.util.Date;

import com.suyang.syt.model.WeixinMsgReceive;
import com.suyang.syt.model.WeixinUser;
import com.suyang.syt.util.DateFormat;

@SuppressWarnings("serial")
public class WeixinMsgReceiveDTO extends WeixinMsgReceive {

	/** 用户发送消息的时间 */
	private String createDate;
	/** 用户的昵称 */
	private String nickname;
	/** 用户的性别 */
	private int sex;
	/** 用户所在城市 */
	private String city;
	/** 用户头像 */
	private String headimgurl;
	/** 用户关注的时间 */
	private String subscribeDate;
	/** 用户的备注 */
	private String remark;

	public WeixinMsgReceiveDTO() {

	}

	public WeixinMsgReceiveDTO(WeixinMsgReceive weixinMsgReceive, WeixinUser weixinUser) {
		if (weixinUser != null) {
			this.setCity(weixinUser.getCity());
			this.setHeadimgurl(weixinUser.getHeadimgurl());
			this.setNickname(weixinUser.getNickname());
			this.setRemark(weixinUser.getRemark());
			this.setSex(weixinUser.getSex());
			this.setSubscribeDate(weixinUser.getSubscribe_time());
		}
		if (weixinMsgReceive != null) {
			this.setContent(weixinMsgReceive.getContent());
			this.setCount(weixinMsgReceive.getCount());
			this.setCreateDate(DateFormat.dateToString(new Date(weixinMsgReceive.getCreateTime() * 1000)));
			this.setCreateTime(weixinMsgReceive.getCreateTime());
			this.setDescription(weixinMsgReceive.getDescription());
			this.setEvent(weixinMsgReceive.getEvent());
			this.setEventKey(weixinMsgReceive.getEventKey());
			this.setFormat(weixinMsgReceive.getFormat());
			this.setFromUserName(weixinMsgReceive.getFromUserName());
			this.setId(weixinMsgReceive.getId());
			this.setLabel(weixinMsgReceive.getLabel());
			this.setLatitude(weixinMsgReceive.getLatitude());
			this.setLocation_X(weixinMsgReceive.getLocation_X());
			this.setLocation_Y(weixinMsgReceive.getLocation_Y());
			this.setLongitude(weixinMsgReceive.getLongitude());
			this.setMediaId(weixinMsgReceive.getMediaId());
			this.setMsgId(weixinMsgReceive.getMsgId());
			this.setMsgType(weixinMsgReceive.getMsgType());
			this.setPicMd5Sum(weixinMsgReceive.getPicMd5Sum());
			this.setPicUrl(weixinMsgReceive.getPicUrl());
			this.setPoiname(weixinMsgReceive.getPoiname());
			this.setPrecision(weixinMsgReceive.getPrecision());
			this.setRecognition(weixinMsgReceive.getRecognition());
			this.setScale(weixinMsgReceive.getScale());
			this.setScanResult(weixinMsgReceive.getScanResult());
			this.setScanType(weixinMsgReceive.getScanType());
			this.setThumbMediaId(weixinMsgReceive.getThumbMediaId());
			this.setTicket(weixinMsgReceive.getTicket());
			this.setTitle(weixinMsgReceive.getTitle());
			this.setToUserName(weixinMsgReceive.getToUserName());
			this.setUploadPicName(weixinMsgReceive.getUploadPicName());
			this.setUrl(weixinMsgReceive.getUrl());
		}
	}

	public String getCreateDate() {
		return createDate;
	}

	public void setCreateDate(String createDate) {
		this.createDate = createDate;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public int getSex() {
		return sex;
	}

	public void setSex(int sex) {
		this.sex = sex;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getHeadimgurl() {
		return headimgurl;
	}

	public void setHeadimgurl(String headimgurl) {
		this.headimgurl = headimgurl;
	}

	public String getSubscribeDate() {
		return subscribeDate;
	}

	public void setSubscribeDate(String subscribeDate) {
		this.subscribeDate = subscribeDate;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
}
